package com.gxa.luckin.order.service;

import com.gxa.luckin.core.exception.BusinessException;
import com.gxa.luckin.core.pojo.Shop;
import com.gxa.luckin.order.pojo.Order;
import com.gxa.luckin.order.pojo.OrderItem;
import com.gxa.luckin.order.pojo.OrderStatus;
import com.gxa.luckin.order.dto.OrderDTO;

import java.net.URISyntaxException;
import java.util.List;

/**
 * @author: XHZ
 * @date: 16:00 2021/7/16
 */
public interface OrderService {
    /**
     *  创建订单
     * @param orderDTO 订单数据传输对象
     * @return  订单id
     */
    String createOrder(Long userId, OrderDTO orderDTO, Integer shopId) throws BusinessException, URISyntaxException;

    /**
     * 根据id查询订单信息
     * @param id
     * @return
     */
    Order queryOrderById(String id);

    /**
     * 查询订单状态
     * @param id
     * @return
     */
    OrderStatus queryOrderStatus(String id);


    /**
     * 修改订单状态
     * @param orderId
     * @param status
     * @return
     */
    Boolean updateOrderStatus(String orderId, Integer status);


    /**
     * 取消订单
     * @param orderId
     */
    void cancelOrder(String orderId);

    List<OrderItem> queryOrderItemByOrderId(String orderId);
    /*
     *
     * @author Sanruy Mu
     * @date 2021/7/26 16:27
     * @param null
     * @return null
     */
    List<Order> queryAllByUserId(Long userId);
}
